// 函数接口描述
interface IFunc {
  (x: number, y: number): number
}

let fn1: IFunc = (a: number, b: number): number => {
  return a + b;
}

interface IEventFunc {
  (e: MouseEvent): void
}

let div = document.querySelector('div');
function on(el: HTMLElement, ename: string, callback: IEventFunc) {

}
if (div) {
  on(div, 'click', function (e) {
    console.log(e.clientX);
  })
}


// 接口合并
interface Box {
  height: number;
  width: number;
  fn(a: string): string;
}

interface Box {
  scale: number;
  fn(a: number): number;
}
let box: Box = {
  height: 12,
  width: 1,
  scale: 1,
  fn: function (a: any): any {
    return a;
  }
};

